<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var arr = [1, 2, 3, 4];
        var arr1 = [1, 2, 3, 4];
        function slice(a) {
            for (let i = 0; i < array.length; i++) {
                a[a.length] = array[i];
            }
        }

        //push2(arr, 'a', 'b', 'c');
        //console.log(arr);

        //push2(arr1, 'a');
        //console.log(arr1);

        Array.prototype.push3 = function(){
            //console.log(this);
            for(var i = 0;i < arguments.length;i++){
                //arguments[i]
                this[this.length] = arguments[i];
            }
        }
        arr.push3("a","b","c")
        console.log(arr);

        arr1.push("a","b","c")
        console.log(arr1);
    </script>
</body>

</html>